package com.effort.com.effort.excle.controller;

import com.effort.com.effort.excle.core.util.ServerResponse;
import com.effort.com.effort.excle.param.ConnectionParam;
import com.effort.com.effort.excle.service.ConnectionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ConnectionController {

    @Resource
    private ConnectionService connectionService;

    /**
     *  连接信息
     */
    @PostMapping("connect")
    public ServerResponse connect(@RequestBody  ConnectionParam connectionParam){
        return this.connectionService.connect(connectionParam);
    }

    /**
     *  重新连接
     */
    @PostMapping("reset")
    public ServerResponse resetConnect(@RequestBody  ConnectionParam connectionParam){
        return this.connectionService.resetConnect(connectionParam);
    }

    /**
     *  清除连接信息
     */
    @GetMapping("clearConnect")
    public ServerResponse clearConnect(){
        return this.connectionService.clearConnect();
    }

}
